package May26ch20ex3;

import java.math.BigDecimal;
import java.util.ArrayList;

public class PriceParser implements Parser {

	@Override
	public PriceList parse(String data) {
		String[] numbers = data.split(",");
		PriceList priceList = new PriceList();

		priceList.setPrice(new ArrayList<BigDecimal>());
		for (String string : numbers) {
			priceList.getPrice().add(new BigDecimal(string));
		}
		return priceList;
	}
}